package com.zhan.utils;


import com.zhan.utils.model.CurrentUserInfo;
import com.zhan.utils.model.SysLog;

import java.util.Date;

public class SysLogUtils {

    public static SysLog getSysLog(Object object, Integer type, CurrentUserInfo currentUserInfo) {
        SysLog sysLog = new SysLog();
        sysLog.setUserId(currentUserInfo.getId());
        sysLog.setUsername(currentUserInfo.getUsername());
        sysLog.setPhone(currentUserInfo.getPhone());
        sysLog.setRoleId(currentUserInfo.getRoleId());
        sysLog.setRoleName(currentUserInfo.getRoleName());
        sysLog.setCreateTime(new Date());
        sysLog.setCreateUserId(currentUserInfo.getId());
        sysLog.setIsDelete(Constants.NOT_DEL_VALUE);
        sysLog.setType(type);
        sysLog.setContent(object.toString());
        return sysLog;
    }
}
